package com.htl.exampro.question.api;

import com.htl.exampro.base.model.PageResult;
import com.htl.exampro.base.model.ServerResponse;
import com.htl.exampro.question.pojo.query.QuestionPageParam;
import com.htl.exampro.question.pojo.vo.QuestionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * QuestionApi
 * </p>
 *
 * @author hehehe
 * @since 2025-05-25
 */

@FeignClient(name = "exam-pro-question", contextId = "QuestionApi", path = "/question/question")
public interface QuestionApi {

    @GetMapping("/{id}")
    ServerResponse<QuestionVO> queryQuestionById(@PathVariable("id") String id);

    @PostMapping("/list")
    ServerResponse<List<QuestionVO>> queryQuestionByIds(@RequestBody List<Long> ids);

    @PostMapping("/page")
    ServerResponse<PageResult<QuestionVO>> queryQuestionPage(@Validated @RequestBody QuestionPageParam pageParam);

    @PostMapping("")
    ServerResponse<Integer> saveQuestion(@Validated @RequestBody QuestionVO questionVO);

    @PutMapping("")
    ServerResponse<Integer> updateQuestion(@Validated @RequestBody QuestionVO questionVO);
}
